<?php 
if($rslt_absen != null) :
    if($rslt_absen->num_rows() == 0)
    {
        echo '<td colspan="6"><center>-Data tidak ditemukan-</center></td>';
    }
    else
    {
?>
<!--<form class="rnd8" target="_laporan_<?php echo $id_tahun ?>" method="GET" action="<?php echo site_url('absen_siswa/download_laporan') ?>">
    <div align="right">
        <input type="hidden" name="id_tahun" value="<?php echo $id_tahun ?>" />
        <input type="hidden" name="id_kelas" value="<?php echo $id_kelas ?>" />
        <input type="hidden" name="id_siswa" value="<?php echo $id_siswa ?>" />
        <a class="button small green" href="#" onclick="submit()"><span class="icon-download-alt"></span> &nbsp;Download Absensi</a>
    </div>
</form>-->
<center>
    <label style="font-size: 1.4em;">
        Absensi Siswa   
        T.A <?php echo $rslt_absen->row()->tahun_angkatan; ?> 
        <br/> 
        <br/> 
        Kelas <?php echo $rslt_absen->row()->nama_kelas; ?>
        <br/> 
        <br/>   
    </label>
</center>

<table class="tabel_bordered rnd10 table-striped" border="1">
    <thead>
        <tr>
            <th colspan="6">
                Daftar Absensi
            </th>
        </tr>
        <tr>
            <th rowspan="2">No.</th>
            <th colspan="4">Tanggal Kehadiran</th>
            <th rowspan="2">Status Kehadiran</th>
        </tr>
        <tr>
            <th>
                Hari
            </th>
            <th>
                Tanggal
            </th>
            <th>
                Bulan
            </th>
            <th>
                Tahun
            </th>
        </tr>
    </thead>
        <?php 
        $nomor = 1;
        $total_hadir = 0;
        $total_izin = 0;
        $total_sakit = 0;
        $total_tidak = 0;
        foreach ($rslt_absen->result() as $v_absen)
        {
            $absensi = "";
            switch ($v_absen->status)
            {
                case 1:
                    $absensi = '<span class="icon-ok" title="HADIR"></span>';
                    $total_hadir++;
                    break;
                case 2:
                    $absensi = '<span class="icon-exclamation-sign" title="IZIN"></span>';
                    $total_izin++;
                    break;
                case 3:
                    $absensi = '<span class="icon-ambulance" title="SAKIT"></span>';
                    $total_sakit++;
                    break;
                case 0:
                    $absensi = '<span class="icon-remove" title="TIDAK HADIR - TANPA KETERANGAN"></span>';
                    $total_tidak++;
                    break;
            }
            
            echo '<tr>';
            echo '<td align="right" width="3%">'.$nomor++.'.</td>';
            echo '<td width="20%">'.hari_indo_huruf($v_absen->nama_hari).'</td>';
            echo '<td width="20%">'.substr($v_absen->tanggal, 8, 2).'</td>';
            echo '<td width="20%">'.bulan_indo(substr($v_absen->tanggal, 5, 2)).'</td>';
            echo '<td width="20%">'.substr($v_absen->tanggal, 0, 4).'</td>';
            echo '<td width="%" align="center" style="padding: 5px">'.$absensi.'</td>';
            echo '</tr>';
        }
        ?>
</table>
Keterangan<br/>
<span class="icon-ok" title="HADIR"></span> : Hadir | 
<span class="icon-exclamation-sign" title="IZIN"></span> : Izin | 
<span class="icon-ambulance" title="SAKIT"></span> : Sakit | 
<span class="icon-remove" title="TIDAK HADIR - TANPA KETERANGAN"></span> : Tidak Hadir - Tanpa Keterangan
<br/>
<br/>
<table class="tabel_bordered rnd10 table-striped" border="1">
    <thead>
        <tr>
            <th colspan="4">Total Kehadiran</th>
        </tr>
        <tr>
            <th><span class="icon-ok" title="HADIR"></span> Hadir</th>
            <th><span class="icon-exclamation-sign" title="IZIN"></span> Izin</th>
            <th><span class="icon-ambulance" title="SAKIT"></span> Sakit</th>
            <th><span class="icon-remove" title="TIDAK HADIR - TANPA KETERANGAN"></span> Tidak Hadir</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th width="25%"><?php echo $total_hadir ?></th>
            <th width="25%"><?php echo $total_izin ?></th>
            <th width="25%"><?php echo $total_sakit ?></th>
            <th width="25%"><?php echo $total_tidak ?></th>
        </tr>
        <tr>
            <th colspan="4"><?php echo $rslt_absen->num_rows() ?></th>
        </tr>
    </tbody>
</table>
    <?php } 
 else :
     echo '<center>-data tidak ditemukan-</center>';
endif;?>